package com.sec.lsp.service.impl;

import java.io.IOException;

import org.springframework.stereotype.Service;

import com.sec.base.utils.AjaxJson;
import com.sec.base.utils.BitmapExecute;
import com.sec.lsp.service.LSPService;

@Service("lspService")
public class LSPServiceImpl implements LSPService {

	@Override
	public AjaxJson picHide(String dataPath, String carrierPath, String resultPath) {
		AjaxJson j = new AjaxJson();
		j.setCode("failure");
		j.setMsg("数据隐藏失败");
		try {
			BitmapExecute.DataSourceToBMP(dataPath, carrierPath, resultPath);
			j.setCode("success");
			j.setMsg("数据隐藏成功");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return j;
	}

	@Override
	public AjaxJson picShow(String resultPath, String dataPath) {
		AjaxJson j = new AjaxJson();
		j.setCode("failure");
		j.setMsg("数据导出失败");
		try {
			BitmapExecute.BMPToDataSource(resultPath, dataPath);
			j.setCode("success");
			j.setMsg("数据导出成功");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return j;
	}

}
